/*
  @author: 13813
  @date: 2024/11/8 10:54
*/
public class SwitchDemo {
    public static void main(String[] args) {
        int a = 1;

        switch (a) {
            case 1:
                System.out.println(1);
//                break;
            case 2:
                System.out.println(2);
//                break;
            case 3:
                System.out.println(3);
//                break;
            default:
                System.out.println(0);
        }

         /*
            定义一个月份，输出此月份的天数
         */

        /*int month = 6;
        switch (month) {
            case 1:
                System.out.println("31");
                break;
            case 2:
                System.out.println("29");
                break;
            case 3:
                System.out.println("31");
                break;
            case 4:
                System.out.println("30");
                break;
            case 5:
                System.out.println("31");
                break;
            case 6:
                System.out.println("30");
                break;
            case 7:
                System.out.println("31");
                break;
            case 8:
                System.out.println("31");
                break;
            case 9:
                System.out.println("30");
                break;
            case 10:
                System.out.println("31");
                break;
            case 11:
                System.out.println("30");
                break;
            case 12:
                System.out.println("31");
                break;
        }*/

        int month = 1;
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                System.out.println("31");
                break;
            case 2:
                System.out.println("29");
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                System.out.println("30");
                break;
        }
    }
}
